#include<iostream>
using namespace std;

class X
{
	friend istream& operator>>(istream&, X&);
	friend ostream& operator<<(ostream&, const X&);
	public:
		X(int sz = 1024, int a = 1024);
		void setA(int a);
		int getA() const;
		~X();
	private:
		char *ptr;
		int _a;
};

inline istream& operator>>(istream& in, X& obj)
{
	int t;
	in >> t;
	obj.setA(t);
	return in;
}

inline ostream& operator<<(ostream& out, const X& obj)
{
	out << obj.getA();
	return out;
}

X::X(int sz, int a)
{
	ptr = new char[sz];
	_a = a;
}

void X::setA(int a)
{
	_a = a;
}

int X::getA() const
{
	return _a;
}

X::~X()
{
	delete[] ptr;
}

////////////////////////////////////////////////
int main(int argc, char* argv[])
{
	X xx(100,4);
	cout << xx << endl;
	cin >> xx;
	cout << xx << endl;

	return 0;
}

